import axios from "@/utils/http";
enum Api {
    permission = "/v1/Role",
}

export interface ListParmas {
    page?: number;
    pageSize?: number;
    keyword: string;
}

export interface UserRole {
    updateTime: string;
    uUID: string;
    roleName: string;
    roleDescribe: string;
    roleStatus: number;
    rolePermissions: string;
}

interface RespUserRoleList {
    list: UserRole[];
    total: number;
}   

// 获取权限列表
export const  List = (params: ListParmas) => {
    return axios.get<RespUserRoleList>(Api.permission,params);
  };

// 获取权限详情
export const  details = (uuid: string) => {
    return axios.get<UserRole>(Api.permission + "/" + uuid);
  };

// 更新权限
export const  Update = (params: UserRole) => {
    return axios.put(Api.permission, params);
  };

// 删除权限
export const  Delete = (uuid:string) => {
    return axios.delete(Api.permission+ "/" + uuid);
  };

// 创建权限
export const  Create = (params: UserRole) => {
    return axios.post(Api.permission, params);
  };